DeleteValue

The DeleteValue method deletes a named value from a specified registry key.

Syntax

DeleteValue FullKeyValueName [,Flush]

Parameters

FullKeyValueName
A string that specifies the named value. This string should consist of a key name followed by a value name. For example, to specify the value MyValue stored in the key HKLM\Software\MyCompany, you would use the following string:

HKLM\Software\MyCompany\MyValue

The key portion of this parameter can be a key on either a local or a remote machine. Keys on a remote machine are specified by prefixing the key name with the machine name. For example:

\\RemoteMachine\HKLM\Software\MyProg


Flush
This optional parameter is a BOOLEAN that specifies whether the registry changes that this method causes should be written to the disk immediately.

If Flush is set to TRUE, the method writes the registry changes to the disk immediately. Note that explicitly flushing registry changes to the disk may reduce server performance.

If Flush is FALSE, the method does not write the registry changes to the disk. They are instead written to disk by the registry's lazy flusher or when the system shuts down.

The default is FALSE.

Example

The following example deletes the named value MyValue, which is stored in the registry key HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ASP\.
<% 
Set Reg = Server.CreateObject("IISSample.Registry")
Reg.DeleteValue "HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ASP\MyValue", False 
%>
 

Applies To

Registry Access Component

See Also

DeleteKey